package cn.webrx.t3;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Demo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        T t = new T(3);
        FutureTask<Integer> f1 = new FutureTask<>(t);
        Thread tt = new Thread(f1);
        tt.start();
        System.out.println(f1.get());


        T t2 = new T();
        FutureTask<Integer> f2 = new FutureTask<>(t2);
        Thread tt2 = new Thread(f2);
        tt2.start();
        System.out.println(f2.get());

    }
}
